<template>
  <div>
    <h1>Mine</h1>
    <van-button @click="$router.push('/darkMode')">进入深色模式</van-button>
    <van-button @click="onLoggedOut">推出登陆</van-button>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  name: 'mine',
  deactivated() {
    console.log('mine - deactivated')
  },
  destroyed() {
    console.log('mine - destroyed')
    // alert('我要退出了')
  },
  methods: {
    ...mapMutations(['SET_LOGIN_TOKEN']),
    onLoggedOut() {
      this.SET_LOGIN_TOKEN('')
      this.$router.push('/login')
    },
  },
}
</script>

<style></style>
